package com.pan.controller.animal;

import com.pan.common.barrier.filter.SecondFilter;
import com.pan.service.AnimalService;
import com.pan.service.BiologyService;
import com.pan.service.DogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dog")
public class DogController {

    @Autowired
    private DogService dogService;

    @Autowired
    private ApplicationContext applicationContext;

    @Autowired
    private AnimalService animalService;

    @RequestMapping("/control")
    public void control(){
        dogService.control();
        animalService.doNewThind();
    }

    @RequestMapping("/getOneDog")
    public String getOneDog(){
        String dog = dogService.getOneDog();

        return dog;

    }

    @RequestMapping("/prototype/service")
    public void serviceTest(){
        System.out.println("this service is "+ getServiceImpl());
    }

    public AnimalService getServiceImpl(){ return applicationContext.getBean(AnimalService.class); }


}
